package com.godpaper.the5elements.util
{
	import com.godpaper.the5elements.model.BoardModel;

	public class DebugUtil
	{
		/**
		 * Prints out all elements (for debug/demo purposes).
		 * 
		 * @return A human-readable representation of the structure.
		 */
		public static function dumpGameGraph():String
		{
			var s:String = "GameGraph,size:"+BoardModel.getInstance().gameGraph.size()+"\n{";
			for(var i:int=0;i<BoardModel.getInstance().gameGraph.nNodes();i++)
			{
				s += "\n\tEdge["+i+"]:";
				if(BoardModel.getInstance().gameGraph.edge(i).length>0)
				{
					for(var j:int=0;j<BoardModel.getInstance().gameGraph.edge(i).length;j++)
					{
						s += BoardModel.getInstance().gameGraph.edge(i)[j].dump();
					}
				}else
				{
					s += "?";
				}
			}
			s += "\n"+"}";
			return s;
		}
	}
}